package cn.ac.iscas.algorithm;

import static org.junit.Assert.*;

import org.junit.Test;

import cn.ac.iscas.focuscrawler.Link;

/**
 * @author Simon@itechs
 *
 */
public class PriorityQueueTest {

	@Test
	public void test() {
		Link[] l = new Link[10];
		l[0] = new Link("3", 3);
		l[1] = new Link("6", 6);
		l[2] = new Link("1", 1);
		l[3] = new Link("9", 9);
		l[4] = new Link("2", 2);
		l[5] = new Link("5", 5);
		l[6] = new Link("4", 4);
		l[7] = new Link("7", 7);
		l[8] = new Link("10", 10);
		l[9] = new Link("8", 8);
		
		PriorityQueue q = new PriorityQueue();
		for (int i = 0; i < l.length; i++){
			q.put(l[i]);
		}
		
		while (!q.isEmpty()){
			System.out.println(((Link)q.extractMax()).url);
		}
	}

}
